select * from ms_price_group
select * into #a from ms_style_price where price_grp = 'KOYO GROUP' and mark_price <> 0

select *  from #a a
where not exists(
select * from ms_style_price aa 
	where aa.price_grp = 'CHN GROUP' and a.style_no = aa.style_no and 
a.sku = aa.sku and mark_price > 0)


begin tran
declare @upd_id int
select @upd_id = convert(int, var_data) from igs_parm with(updlock) where var_name = 'gv_upd_id'

update ms_style_price set mark_price = a.mark_price , upd_id = @upd_id
from #a a
where ms_style_price.style_no = a.style_no and 
		ms_style_price.sku = a.sku and 
		ms_style_price.mark_price = 0 and 
ms_style_price.price_grp = 'CHN GROUP'
rollback tran